<template>
  <view class="tab-component">
    <view class="tab-box">
      <view class="left-tab-item">
        <view class="left-content animation">
          <image src="/static/common/libao.png" class="libao-img" />
        </view>
        <view class="right-content">
          <text class="title">惊喜不断</text>
          <text class="des">天天领好礼</text>
        </view>
      </view>
      <view class="left-tab-item">
        <view class="left-content">
          <image src="/static/dataImage/taobao/002.avif" class="libao-img" />
        </view>
        <view class="right-content">
          <text class="title">直降15%起</text>
          <text class="des">儿童服饰</text>
        </view>
      </view>
    </view>
    <view class="center-box">
      <view class="image-box">
        <image src="/static/common/11.png" class="img-style" mode="widthFix" />
      </view>
      <view class="title"> 直降1折起 </view>
    </view>
    <view class="circle"></view>
    <view class="bottom-box">
      <text class="title">主会场</text>
      <text class="iconfont icon-weibiaoti--10"></text>
    </view>
  </view>
</template>

<script>
import { defineComponent, reactive, toRefs } from "vue";
export default defineComponent({
  name: "",
  props: {},
  components: {},
  setup() {
    const data = reactive({});
    return {
      ...toRefs(data),
    };
  },
});
</script>

<style scoped lang="less">
// 红包动画
@keyframes hongbao {
  0% {
    // 角度
    transform: scale(1);
  }
  10% {
    transform: scale(1.2) rotate(10deg);
  }
  20% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.2) rotate(-10deg);
  }
  40% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
  }
}

.tab-component {
  display: flex;
  flex-direction: column;
  border-radius: 6rpx;
  position: relative;
  .tab-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    // grid-template-rows: repeat(2, 100rpx);
    column-gap: 150rpx;
    row-gap: 0rpx;
    width: 100%;
    padding: 10rpx;
    box-sizing: border-box;
    background: #ff0f23;
    border-radius: 10rpx;
    .left-tab-item {
      display: flex;
      background: #fff;
      flex-direction: row;
      justify-content: start;
      align-items: center;
      padding: 10rpx 15rpx;
      padding-right: 0;
      box-sizing: border-box;
      border-radius: 10rpx;
      position: relative;
      .left-content {
        width: 80rpx;
        height: 80rpx;
        border-radius: 6rpx;
        overflow: hidden;
        &.animation {
          animation-name: hongbao;
          animation-duration: 7s;
          animation-iteration-count: infinite;
        }
        .libao-img {
          width: 100%;
          height: 100%;
        }
      }
      .right-content {
        display: flex;
        flex-direction: column;
        justify-content: start;
        margin-left: 10rpx;
        .title {
          font-size: 26rpx;
          font-weight: 700;
          color: #ff0f23;
          line-height: 40rpx;
        }
        .des {
          font-size: 24rpx;
          color: #666;
        }
      }
    }
  }
  .center-box {
    position: absolute;
    top: 36%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
    border-radius: 10rpx 10rpx 0 0;
    width: 150rpx;
    background: #ff0f23;
    padding-bottom: 4rpx;
    .image-box {
      width: 80%;
      border-radius: 10rpx;
      overflow: hidden;
      .img-style {
        display: block;
        width: 100%;
      }
    }

    .title {
      background: #ff0f23;
      border-radius: 10rpx;
      padding: 0 10rpx;
      animation-name: hongbao;
      animation-duration: 5s;
      animation-iteration-count: infinite;
      font-size: 26rpx;
      margin-top: 2rpx;
      color: #fff;
      // letter-spacing: -4rpx; /* 增加字符间距 */
      font-weight: 300;
    }
  }
  .circle {
    position: absolute;
    z-index: 0;
    top: -15rpx;
    left: 50%;
    transform: translateX(-50%);
    width: 150rpx;
    height: 100rpx;
    border-radius: 50%;
    background: #ff0f23;
  }
  .bottom-box {
    position: absolute;
    bottom: 0;
    left: 50%;
    z-index: 99;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background: #ea4b52;
    border-radius: 10rpx 10rpx 0 0;
    height: 40rpx;
    // 内阴影
    box-shadow: inset 0rpx 2rpx 2rpx rgba(255, 255, 255, 0.9);
    width: 170rpx;
    .title {
      color: #fff;
      margin-right: 10rpx;
      font-size: 26rpx;
      line-height: 40rpx;
      font-weight: 700;
    }
    .icon-weibiaoti--10 {
      display: block;
      transform: rotate(180deg);
      width: 22rpx;
      height: 22rpx;
      line-height: 24rpx;
      text-align: center;
      font-size: 18rpx;
      border-radius: 50%;
      color: #ff3f4b;
      background: #fff;
    }
  }
}
</style>
